package com.qd.common.panda.domain.entity.wallet.user;

import com.cdqidi.dict.annotation.FieldBind;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.qd.common.dict.DictConstant;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * 关联订单
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UserWalletRefundApplyOrderDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "退款ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "退款ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String refundId;
    /**
     * 实际支付金额
     */
    private BigDecimal payAmount;
    /**
     * 退款金额
     */
    private BigDecimal refundAmount;
    /**
     * 退款状态:0退款中1退款成功2退款失败
     */
    @FieldBind(targetField = "refundStatusDisplay", processName = DictConstant.REFUND_STATUS)
    private Integer refundStatus;
    /**
     * 退款状态显示
     */
    private String refundStatusDisplay;
    /**
     * 申请ID
     */
    @NotBlank(message = "申请ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "申请ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String requestId;
    /**
     * 订单ID
     */
    @NotBlank(message = "订单ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "订单ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String orderId;

    @Override
    public void freeData() {
        this.refundId = null;
        this.payAmount = null;
        this.refundAmount = null;
        this.refundStatus = null;
        this.requestId = null;
        this.orderId = null;
        this.refundStatusDisplay = null;
        super.freeData();
    }
}
